<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:a4j="http://richfaces.org/a4j"
	xmlns:rich="http://richfaces.org/rich">

	<h:head>
		<h:outputStylesheet name="style.css" library="css" />
    </h:head>

	<h:body>
		<rich:popupPanel id="loadingDialog" header="#{msg.label_system_operation}">
			<h:graphicImage value="/protected/img/loading.gif" />
			<h:outputText value="#{msg.lbl_pls_wait}" />
		</rich:popupPanel>
		
		<div id="loginContainer">
			<div id="loginContent">
				
				<h:form id="loginForm">
					<p class="spacer"/>
					<p class="alignCenter">${msg.system_name}<br/>${msg.system_version} ${msg.system_field}<br/>${msg.system_release_date}</p>
					<a4j:outputPanel rendered="#{!ldap.SSO_ENABLED}">
						<p><label><h:outputText value="#{msg.lbl_login_ldap_id}" /></label><h:inputText id="userName" value="#{user.id}" onblur="convertToUpperCase(this);" /></p>
						<p><label><h:outputText value="#{msg.lbl_login_pwd}" /></label><h:inputSecret id="password" value="#{user.password}" redisplay="false" /></p>
						<p class="alignCenter"><h:commandButton id="submitId" value="#{msg.button_login}" action="#{loginBean.login}" onclick="allowRedirect();#{rich:component('loadingDialog')}.show();" oncompleted="#{rich:component('loadingDialog')}.hide();" /></p>
					</a4j:outputPanel>
					<a4j:outputPanel rendered="#{ldap.SSO_ENABLED}">
						<p class="alignCenter">
							<h:outputLink value="/crm/index.xhtml">
								<h:outputText value="#{msg.label_system_login_again}" />
							</h:outputLink>
						</p>
					</a4j:outputPanel>
					<rich:messages layout="list" errorClass="loginErrorMessage" fatalClass="loginErrorMessage" infoClass="loginSystemMessage" warnClass="loginWarnMessage" showSummary="true" showDetail="false" />
					<a4j:status id="loginStatus" onstart="#{rich:component('loadingDialog')}.show()" />
				</h:form>
			</div>
	    </div>
	</h:body>
	<h:outputScript name="common.js" library="js" />
</html>

